package com.my.user.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.my.common.JsonUtil;
import com.my.user.entity.User;
import com.my.user.service.UserService;

@RestController
public class UserController {
	@Autowired
	private UserService userService;

	@RequestMapping("getLogin")
	public String getLogin() {
		Map<String, Object> map = new HashMap<String, Object>();

		return JsonUtil.success(userService.getLogin(map));
	}
	
	@RequestMapping("addUser")
	public String addUser(User user) {
		userService.addUser(user);
		return JsonUtil.success();
	}
}
